package study.sharding.shardingjdbc.support.ms;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.spi.masterslave.MasterSlaveLoadBalanceAlgorithm;

import java.util.List;
import java.util.Properties;

@Slf4j
public class CustomLoadBalanceAlgorithm implements MasterSlaveLoadBalanceAlgorithm {

    @Override
    public String getDataSource(String name, String masterDataSourceName, List<String> slaveDataSourceNames) {
       log.info(">>>>>> {}", masterDataSourceName);
        return masterDataSourceName;
    }

    @Override
    public String getType() {
        return "test";
    }

    @Override
    public Properties getProperties() {
        return null;
    }

    @Override
    public void setProperties(Properties properties) {
    }
}
